<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>案例1</title>
</head>
<style>
    body {
        width: 100%;
        height: 100vh;
    }
</style>

<body>

</body>

</html>
<script>
    var body = document.querySelector("body")
    body.addEventListener("click", function() {
        var event = event || window.event;
        // 
        alert("坐标:[ " + event.clientX + ',' + event.clientY + "]")
    })
</script>